package com.wangshouyu.mp.pay.v3.transactions;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 交易商品详情
 * @date 2020/8/14 9:35
 */
public class TransactionsGoodsDetail implements Serializable {

    /**
     * 商品编码
     */
    @SerializedName(value = "goods_id")
    @JsonProperty(value = "goods_id")
    @JSONField(name = "goods_id")
    private String goodsId;

    /**
     * 商户侧商品编码
     */
    @SerializedName(value = "merchant_goods_id")
    @JsonProperty(value = "merchant_goods_id")
    @JSONField(name = "merchant_goods_id")
    private String merchantGoodsId;

    /**
     * 微信侧商品编码
     */
    @SerializedName(value = "wechatpay_goods_id")
    @JsonProperty(value = "wechatpay_goods_id")
    @JSONField(name = "wechatpay_goods_id")
    private String wechatpayGoodsId;

    /**
     * 商品名称
     */
    @SerializedName(value = "goods_name")
    @JsonProperty(value = "goods_name")
    @JSONField(name = "goods_name")
    private String goodsName;

    /**
     * 商品数量
     */
    @SerializedName(value = "quantity")
    @JsonProperty(value = "quantity")
    @JSONField(name = "quantity")
    private Integer quantity;

    /**
     * 商品单价
     */
    @SerializedName(value = "unit_price")
    @JsonProperty(value = "unit_price")
    @JSONField(name = "unit_price")
    private Integer unitPrice;

    /**
     * 商品优惠金额
     */
    @SerializedName(value = "discount_amount")
    @JsonProperty(value = "discount_amount")
    @JSONField(name = "discount_amount")
    private String discountAmount;

    /**
     * 商品备注
     */
    @SerializedName(value = "goods_remark")
    @JsonProperty(value = "goods_remark")
    @JSONField(name = "goods_remark")
    private String goodsRemark;

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getMerchantGoodsId() {
        return merchantGoodsId;
    }

    public void setMerchantGoodsId(String merchantGoodsId) {
        this.merchantGoodsId = merchantGoodsId;
    }

    public String getWechatpayGoodsId() {
        return wechatpayGoodsId;
    }

    public void setWechatpayGoodsId(String wechatpayGoodsId) {
        this.wechatpayGoodsId = wechatpayGoodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Integer getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(Integer unitPrice) {
        this.unitPrice = unitPrice;
    }

    public String getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(String discountAmount) {
        this.discountAmount = discountAmount;
    }

    public String getGoodsRemark() {
        return goodsRemark;
    }

    public void setGoodsRemark(String goodsRemark) {
        this.goodsRemark = goodsRemark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionsGoodsDetail that = (TransactionsGoodsDetail) o;
        return Objects.equals(goodsId, that.goodsId) &&
                Objects.equals(merchantGoodsId, that.merchantGoodsId) &&
                Objects.equals(wechatpayGoodsId, that.wechatpayGoodsId) &&
                Objects.equals(goodsName, that.goodsName) &&
                Objects.equals(quantity, that.quantity) &&
                Objects.equals(unitPrice, that.unitPrice) &&
                Objects.equals(discountAmount, that.discountAmount) &&
                Objects.equals(goodsRemark, that.goodsRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(goodsId, merchantGoodsId, wechatpayGoodsId, goodsName, quantity, unitPrice, discountAmount, goodsRemark);
    }

    @Override
    public String toString() {
        return "TransactionsGoodsDetail{" +
                "goodsId='" + goodsId + '\'' +
                ", merchantGoodsId='" + merchantGoodsId + '\'' +
                ", wechatpayGoodsId='" + wechatpayGoodsId + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", quantity=" + quantity +
                ", unitPrice=" + unitPrice +
                ", discountAmount='" + discountAmount + '\'' +
                ", goodsRemark='" + goodsRemark + '\'' +
                '}';
    }
}
